package pattern.singleton;

import lombok.Data;

/**
 * 单例类
 *
 * @author sun.ye
 * @since 2020-07-16 17:09
 */
@Data
public class Singleton {

    private static Singleton instance;

    private String name;

    private Singleton() {
    }

    public static Singleton getInstance() {
        if (instance == null) {
            instance = new Singleton();
        }
        return instance;
    }
}